package com.common.function.file;

import java.io.IOException;

/**
 * @author ben.huang
 */
public class TestFileFunction {
    public static void main(String[] args) {
        String fileName = "C:\\Users\\ben.huang\\Desktop\\testFile.txt";
        FileFunction fileFunction = new FileFunction();

        try {
            //方法调用的时候，传入需要的处理函数即可
            System.out.println("File content in uppercase:");
            fileFunction.processFile(fileName,FileProcessingStrategies.toUpperCase());

            System.out.println("\nFile content in lowercase:");
            fileFunction.processFile(fileName,FileProcessingStrategies.toLowerCase());


            System.out.println("\nFile content in encrypted:");
            fileFunction.processFile(fileName,FileProcessingStrategies.encrypt());


        } catch (IOException e) {
            throw new RuntimeException(e);
        }


    }
}
